package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.KkProductSpecMapper;
import com.ruoyi.system.domain.KkProductSpec;
import com.ruoyi.system.service.IKkProductSpecService;

/**
 * 商城商品规格Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-05-24
 */
@Service
public class KkProductSpecServiceImpl implements IKkProductSpecService 
{
    @Autowired
    private KkProductSpecMapper kkProductSpecMapper;

    /**
     * 查询商城商品规格
     * 
     * @param id 商城商品规格主键
     * @return 商城商品规格
     */
    @Override
    public KkProductSpec selectKkProductSpecById(Integer id)
    {
        return kkProductSpecMapper.selectKkProductSpecById(id);
    }

    /**
     * 查询商城商品规格列表
     * 
     * @param kkProductSpec 商城商品规格
     * @return 商城商品规格
     */
    @Override
    public List<KkProductSpec> selectKkProductSpecList(KkProductSpec kkProductSpec)
    {
        return kkProductSpecMapper.selectKkProductSpecList(kkProductSpec);
    }

    /**
     * 新增商城商品规格
     * 
     * @param kkProductSpec 商城商品规格
     * @return 结果
     */
    @Override
    public int insertKkProductSpec(KkProductSpec kkProductSpec)
    {
        return kkProductSpecMapper.insertKkProductSpec(kkProductSpec);
    }

    /**
     * 修改商城商品规格
     * 
     * @param kkProductSpec 商城商品规格
     * @return 结果
     */
    @Override
    public int updateKkProductSpec(KkProductSpec kkProductSpec)
    {
        kkProductSpec.setUpdateTime(DateUtils.getNowDate());
        return kkProductSpecMapper.updateKkProductSpec(kkProductSpec);
    }

    /**
     * 批量删除商城商品规格
     * 
     * @param ids 需要删除的商城商品规格主键
     * @return 结果
     */
    @Override
    public int deleteKkProductSpecByIds(Integer[] ids)
    {
        return kkProductSpecMapper.deleteKkProductSpecByIds(ids);
    }

    /**
     * 删除商城商品规格信息
     * 
     * @param id 商城商品规格主键
     * @return 结果
     */
    @Override
    public int deleteKkProductSpecById(Integer id)
    {
        return kkProductSpecMapper.deleteKkProductSpecById(id);
    }
}
